% Red-black tree
% Author: Madit
\documentclass{article}
\usepackage{tikz}
%%%<
\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength{\PreviewBorder}{10pt}%
%%%>
\begin{comment}
:Title: Red-black tree
:Tags: Trees;Graphs
:Author: Madit
:Slug: red-black-tree

A red-black tree is a special type of binary tree, used in computer science
to organize pieces of comparable data, such as text fragments or numbers.
(Wikipedia)
\end{comment}
\usetikzlibrary{arrows}

\tikzset{
  treenode/.style = {align=center, inner sep=0pt, text centered,
    font=\sffamily},
  arn_n/.style = {treenode, circle, white, font=\sffamily\bfseries, draw=black,
    fill=black, text width=2.0em},% arbre rouge noir, noeud noir
  arn_r/.style = {treenode, circle, red, draw=red, 
    text width=2.0em, very thick},% arbre rouge noir, noeud rouge
  arn_x/.style = {treenode, rectangle, draw=black,
    minimum width=0.5em, minimum height=0.5em}% arbre rouge noir, nil
}

\begin{document}
\begin{tikzpicture}[->,>=stealth',level/.style={sibling distance = 5cm/#1,
  level distance = 1.5cm}] 
\node [arn_n] {$\frac{17,19}{23}$}
	child{ node [arn_r] {$\frac{5, 11}{18}$} 
		child{ node [arn_n] {$\frac{4, 8}{8}$} } 
		child{ node [arn_n] {$\frac{15, 18}{18}$} 
			child{ node [arn_r] {$\frac{7, 10}{10}$} } 
			child{ node [arn_x] {} } } }
    	child{ node [arn_n] {$\frac{21,23}{23}$} }; 
\end{tikzpicture}
\end{document}